package com.cjg.xiancheng;

import java.util.concurrent.CopyOnWriteArrayList;

public class threadCu {
    public static void main(String[] args) {
        CopyOnWriteArrayList<String> list =new CopyOnWriteArrayList<String>();
        for (int i = 0; i < 10000; i++)
            new Thread(() -> {
                list.add(Thread.currentThread().getName());
            }).start();



        System.out.println(list.size());
    }
}
